<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>本月销售额</title>
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/homePage.css">
    <link rel="stylesheet" href="css/flexible.css">
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/flexible.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/MD5.js"></script>
</head>
<body>
<div class="container_box" id="app">
    <div class="add_jl"><a href="index.html"><img src="images/back.png"></a></div>
    <template>
        <table class="tabel_mon">
            <thead>
                 <tr>
                     <th>会员卡名称</th>
                     <th>数量</th>
                     <th>销售额<span>&nbsp;&nbsp;(元)</span></th>
                 </tr>
            </thead>
            <tbody>
                 <tr v-for="item in list" :key="item.id">
                     <td>{{item.Cardname}}</td>
                     <td>{{item.Num}}</td>
                     <td>{{item.Acamount}}</td>
                 </tr>
            </tbody>
        </table> 
    </template>
   <div v-if="list.length==0" style="text-align: center;height:30px;line-height:30px;color:#999999;">暂无数据</div>
</div>
</body>
<script>
    new Vue({
            el: '#app',
            data: {
                type:'',
                list:[],
            },
            created(){
                this.setCanS()
            },
            methods:{
                //设置参数
                setCanS(){
                    let Request = new Object()
                    Request = GetRequest()
                    this.type = Request['type']
                    if(this.type=='1'){
                        this.type=''
                    }
                    getVs()
                    this.getList()
                },
                //获取信息
                getList(){
                    const params={
                        type:this.type
                    }
                    axios.get('/mobileapi/adviser/index.php?act=sales',{params:params}).then(data =>{
                        console.log(data)
                        let { msg, code,user} = data.data
                            if (code !== 200) {
                                _this.$message({
                                    message: msg,
                                    type: 'error'
                                });
                            } else {
                                data=data.data
                                this.list=data.data
                            }
                        }).catch(function (error) { 
                            console.log(error); 
                    });
                }
            }
        })
</script>
</html>